package com.cmdi.constant;

/**
 * @Description: CodeConstant
 * @Author: gaozb
 */
public class CodeConstants {

    /**
     * 后端返回前端JSON-key值
     */
    public final static String MSG_VALUE = "msg";
    public final static String CODE_VALUE = "code";

    /**
     * sentinel的限流异常代码、信息
     */
    public final static int XIANLIU_SENTINEL = 429;
    public final static String XIANLIU_SENTINEL_MESSAGE = "";

    /**
     * 鉴权授权
     */
    public final static int ACCESS_DENIED_CODE = 401;
    public final static String ACCESS_DENIED_MESSAGE = "AccessDenied";
    public final static int TOKEN_ERROR_CODE = 402;
    public final static String TOKEN_ERROR_MESSAGE = "TokenInvalid";

    /**
     * 返回状态标记
     */
    public static final Integer SUCCESS = 200;
    public static final Integer FAIL = 500;

    /**
     * 错误、异常消息前缀
     */
    public static final String ERROR_REASON_PREFIX = "错误原因:";
    public static final String FLOW_EXCEPTION_PREFIX = "流控异常:";
    public static final String DEGRADE_EXCEPTION_PREFIX = "降级异常:";
    public static final String OTHER_EXCEPTION_PREFIX = "其他异常:";

}